<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>批改结果 - 教育AI助手</title>
    <link rel="stylesheet" href="/static/css/style.css">
    <style>
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }
        .result-box {
            background-color: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 20px;
            margin-top: 20px;
            white-space: pre-wrap;
        }
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            text-decoration: none;
            display: inline-block;
            margin-top: 20px;
            margin-right: 10px;
        }
        .btn-primary {
            background-color: #4CAF50;
            color: white;
        }
        .btn-primary:hover {
            background-color: #45a049;
        }
        .btn-secondary {
            background-color: #2196F3;
            color: white;
        }
        .btn-secondary:hover {
            background-color: #1976D2;
        }
        .alert {
            padding: 15px;
            margin-bottom: 20px;
            border: 1px solid transparent;
            border-radius: 4px;
        }
        .alert-success {
            color: #3c763d;
            background-color: #dff0d8;
            border-color: #d6e9c6;
        }
        .alert-danger {
            color: #a94442;
            background-color: #f2dede;
            border-color: #ebccd1;
        }
        .meta-info {
            margin-bottom: 20px;
            color: #666;
        }
        .meta-info p {
            margin: 5px 0;
        }
        .exam-image {
            max-width: 100%;
            margin: 20px 0;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>批改结果</h1>
        
        <div th:if="${success}" class="alert alert-success" th:text="${success}"></div>
        <div th:if="${error}" class="alert alert-danger" th:text="${error}"></div>
        
        <div class="meta-info">
            <p th:if="${record.grade}" th:text="'年级：' + ${record.grade}"></p>
            <p th:if="${record.subject}" th:text="'科目：' + ${record.subject}"></p>
            <p th:if="${record.answerRequirements}" th:text="'答案要求：' + ${record.answerRequirements}"></p>
            <p th:text="'提交时间：' + ${#temporals.format(record.createdAt, 'yyyy-MM-dd HH:mm:ss')}"></p>
        </div>

        <div th:if="${record.imagePath}">
            <h3>试卷图片</h3>
            <img th:src="@{'/uploads/' + ${record.imagePath}}" class="exam-image" alt="试卷图片">
        </div>
        
        <div th:if="${record.result}" class="result-box" th:text="${record.result}"></div>
        
        <div>
            <a href="/exam-submit" class="btn btn-primary">继续批改</a>
            <a href="/exam-history" class="btn btn-secondary">查看历史</a>
        </div>
    </div>
</body>
</html> 